package com.hopu.aop.proxy.cglibproxy;

import com.hopu.aop.proxy.IComputerSell;
import com.hopu.aop.proxy.MiComputerFactory;
import com.hopu.aop.proxy.proxy.IPhoneSell;
import com.hopu.aop.proxy.proxy.MiPhoneFactory;

public class CGLibTest {
    public static void main(String[] args) {
        IComputerSell factory1 = new MiComputerFactory();
        IPhoneSell factory2 = new MiPhoneFactory();
        MyCGLibShop shop = new MyCGLibShop();
        IComputerSell proxy1 = (IComputerSell) shop.createProxy(factory1);
        IPhoneSell proxy2 = (IPhoneSell) shop.createProxy(factory2);
        proxy1.sellComputer();
        proxy2.sellPhone();
    }
}
